﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SocialFront.Providers.Blog;

namespace SocialFront.Web.usercontrols.Blog
{
    public partial class GlobalBlogList : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            List<Entities.Blog> blogs = BlogProvider.Provider.GetAllBlogs(b => b.CreatedDate);
            lvBlogs.DataSource = blogs;
            lvBlogs.DataBind();
        }

        protected void lvBlogs_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
        {
            this.ItemDataPager.SetPageProperties(e.StartRowIndex, e.MaximumRows, false);
            lvBlogs.DataBind();
        }
    }
}